package com.itheima.HomeWork;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Demo02 {
    public static void main(String[] args) throws ParseException {
        System.out.println("请输入自己的生日");
        Scanner scanner=new Scanner(System.in);
        System.out.println("年：");
        int years=scanner.nextInt();
        System.out.println("月：");
        int month=scanner.nextInt();
        System.out.println("日：");
        int day=scanner.nextInt();
        String birth=years+"-"+month+"-"+day;

        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        Date birthDay = sdf.parse(birth);

        long d=new Date().getTime()-birthDay.getTime();
        System.out.println(d/1000/60/60/24+"天");


    }
}
